﻿

using IotContract.Models.InfluxDb;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotContract.Interfaces.Db;
public interface IRealDbService
{
    /// <summary>
    /// 初始化DB
    /// </summary>
    /// <returns></returns>
    Task<string> InitDb();

    /// <summary>
    /// 写入db
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="datas">数据</param>
    /// <param name="bucket">桶</param>
    /// <param name="org">组织</param>
    /// <returns></returns>
    Task<string> WriteDbs<T>(List<T> datas, string bucket, string org);
    /// <summary>
    /// 删除数据库
    /// </summary>
    /// <param name="delete"></param>
    /// <returns></returns>
    Task<string> DeleteDbs(DbDelete delete);

    /// <summary>
    /// 查询数据
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <returns></returns>
    Task<List<T>> QueryDatas<T>(DbQuery query);

    /// <summary>
    /// 查询数据
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <returns></returns>
    Task<List<object>> QueryDatas(DbQuery query);
}
